﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminSite.Master" AutoEventWireup="true" CodeBehind="NewStockOrder.aspx.cs" Inherits="Agents.Admin.NewStockOrder" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
    <h1>
        ביצוע הזמנת מלאי חדשה
    </h1>    
    <asp:Timer ID="redirectionTimer" runat="server" Interval="2000" Enabled="false" 
        ontick="redirectionTimer_Tick" />           
    <hr />      
    <asp:Panel ID="gridPanel" runat="server" Height="300px" Width="100%" ScrollBars="Vertical"> 
        <asp:DataGrid runat="server" ID="dgProducts" AutoGenerateColumns="False"
                BackColor="White" BorderStyle="None" DataSourceID="SqlDataSource1"
                CellPadding="3" GridLines="Both" Height="500px" 
                CssClass="dataGrid" Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
            <AlternatingItemStyle BackColor="#DCDCDC" />
            <Columns>
                <asp:BoundColumn DataField="Id" Visible="false" />
                <asp:BoundColumn DataField="Name" HeaderText="שם" HeaderStyle-Width="50%" ItemStyle-Width="50%" FooterStyle-Width="50%" />
                <asp:BoundColumn DataField="ItemsInStock" HeaderText="פריטים במלאי" HeaderStyle-Width="25%" ItemStyle-Width="25%" FooterStyle-Width="25%" />
                <asp:TemplateColumn HeaderText="פריטים להזמנה" HeaderStyle-Width="20%" ItemStyle-Width="20%" FooterStyle-Width="20%">
                <ItemTemplate>
                    <asp:TextBox ID="txtNumItems" Text="0" runat="server" TextMode="Number" />
                </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <ItemStyle BackColor="White" ForeColor="Black" />
            <PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
            <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        </asp:DataGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
            SelectCommand="SELECT [Id], [Name], [ItemsInStock] FROM [Products] ORDER BY [Name]">
        </asp:SqlDataSource>
    </asp:Panel>
    סכום כללי: 
    <asp:TextBox ID="txtSum" runat="server" />
    <asp:RequiredFieldValidator ID="rqSum" runat="server" ControlToValidate="txtSum" 
        ErrorMessage="יש להזין סכום" />
    <!-- Allow only number for num items -->
    <ajaxToolkit:FilteredTextBoxExtender ID="ftbe" runat="server"
                TargetControlID="txtSum" ValidChars="0123456789." />
    <br />           
    <hr />
    <div class="alignCenter">               
        <asp:Button ID="okBtn" Text="אישור" runat="server" onclick="okBtn_Click" CssClass="button"/>                
        <asp:Button ID="backBtn" Text="חזור" runat="server" onclick="backBtn_Click" 
            CausesValidation="False" CssClass="button"/>
        <asp:Label ID="lblMessage" runat="server" />
    </div>
</asp:Content>
